// --------------------------------------------------------------------------------------------------------------------
// <copyright file="RobotPoseEstimationAgentMessage.cs" company="Microsoft Corporation">
// The MIT License (MIT)
// 
// Copyright (c) 2014, Microsoft Corporation
// 
// Permission is hereby granted, free of charge, to any person obtaining a copy
//  of this software and associated documentation files (the "Software"), to deal
//  in the Software without restriction, including without limitation the rights
//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//  copies of the Software, and to permit persons to whom the Software is
//  furnished to do so, subject to the following conditions:
// 
// The above copyright notice and this permission notice shall be included in
//  all copies or substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//  THE SOFTWARE.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
namespace Microsoft.Robotics.Navigation.Runtime.GroundTruthExtraction
{
    using System;
    using System.Drawing;
    using System.Runtime.Serialization;

    using Microsoft.Robotics.Numerics;
    using Microsoft.Robotics.Runtime;
    using Microsoft.Robotics.Vision;
    using Microsoft.Robotics.Vision.Runtime.GroundTruthExtraction;

    /// <summary>
    /// The RobotPoseEstimationAgentMessage class represents ground truth pose of the robot with respect to the given landmark point.
    /// </summary>
    [DataContract]
    public class RobotPoseEstimationAgentMessage : AgentMessage
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="RobotPoseEstimationAgentMessage" /> class
        /// </summary>
        /// <param name="originatingTime">The robot pose estimation message creation time.</param>        
        /// <param name="globalPose">The global robot pose </param>        
        /// <param name="localPose">The local robot pose </param>        
        /// <param name="landmarkPoint">Landmark point at which this robot pose was estimated</param>
        public RobotPoseEstimationAgentMessage(
            long originatingTime,
            Pose2D? globalPose,
            Pose2D? localPose,
            Landmark landmarkPoint)
            : base(originatingTime)
        {
            this.RobotPose = globalPose;
            this.LocalPose = localPose;
            this.Landmark = landmarkPoint;
        }

        /// <summary>
        /// Gets the global robot pose.
        /// </summary>
        [DataMember]
        public Pose2D? RobotPose { get; private set; }

        /// <summary>
        /// Gets the local robot pose relative to the current landmark.
        /// </summary>
        [DataMember]
        public Pose2D? LocalPose { get; private set; }
        
        /// <summary>
        /// Gets the Landmark against which the pose was estimated.
        /// </summary>
        [DataMember]
        public Landmark Landmark { get; private set; }
    }
}
